{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "outputs": [],
   "source": [
    "                            # 首先 import 必要的模块\n",
    "import pandas as pd \n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "%matplotlib inline"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "outputs": [],
   "source": [
    "train_df = pd.read_csv(\"train_pre.csv\")\n",
    "train_df2 = pd.read_csv(\"train_gbdtappend.csv\")"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "outputs": [],
   "source": [
    "train_df = pd.read_csv(\"train_pre.csv\",nrows=50)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "outputs": [
    {
     "data": {
      "text/plain": "             id  click      hour       C1    banner_pos           site_id  \\\n0  1.000009e+18      0  14102100  C1_1005  banner_pos_0  site_id_1fbe01fe   \n1  1.000017e+19      0  14102100  C1_1005  banner_pos_0  site_id_1fbe01fe   \n2  1.000037e+19      0  14102100  C1_1005  banner_pos_0  site_id_1fbe01fe   \n3  1.000064e+19      0  14102100  C1_1005  banner_pos_0  site_id_1fbe01fe   \n4  1.000068e+19      0  14102100  C1_1005  banner_pos_1  site_id_fe8cc448   \n\n            site_domain           site_category           app_id  \\\n0  site_domain_f3845767  site_category_28905ebd  app_id_ecad2386   \n1  site_domain_f3845767  site_category_28905ebd  app_id_ecad2386   \n2  site_domain_f3845767  site_category_28905ebd  app_id_ecad2386   \n3  site_domain_f3845767  site_category_28905ebd  app_id_ecad2386   \n4  site_domain_9166c161  site_category_0569f928  app_id_ecad2386   \n\n            app_domain  ...         C20      C21                    user_id  \\\n0  app_domain_7801e8d9  ...      C20_-1   C21_79  user_id_ddd2926e_44956a24   \n1  app_domain_7801e8d9  ...  C20_100084   C21_79                 uid_rare_7   \n2  app_domain_7801e8d9  ...  C20_100084   C21_79                 uid_rare_2   \n3  app_domain_7801e8d9  ...  C20_100084   C21_79                 uid_rare_2   \n4  app_domain_7801e8d9  ...      C20_-1  C21_157  user_id_9644d0bf_779d90c2   \n\n     user_id&media_id    user_id&C14_d    user_id&C17_d    user_id&C14_h  \\\n0  user_id&media_id_1  user_id&C14_d_1  user_id&C17_d_1  user_id&C14_h_1   \n1  user_id&media_id_1  user_id&C14_d_1  user_id&C17_d_1  user_id&C14_h_1   \n2  user_id&media_id_1  user_id&C14_d_1  user_id&C17_d_1  user_id&C14_h_1   \n3  user_id&media_id_1  user_id&C14_d_1  user_id&C17_d_1  user_id&C14_h_1   \n4  user_id&media_id_1  user_id&C14_d_1  user_id&C17_d_1  user_id&C14_h_1   \n\n     user_id&C17_h     time   uid_day  \n0  user_id&C17_h_1  time_-1  id_day_3  \n1  user_id&C17_h_1  time_-1  id_day_1  \n2  user_id&C17_h_1  time_-1  id_day_1  \n3  user_id&C17_h_1  time_-1  id_day_1  \n4  user_id&C17_h_1  time_-1  id_day_1  \n\n[5 rows x 32 columns]",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>id</th>\n      <th>click</th>\n      <th>hour</th>\n      <th>C1</th>\n      <th>banner_pos</th>\n      <th>site_id</th>\n      <th>site_domain</th>\n      <th>site_category</th>\n      <th>app_id</th>\n      <th>app_domain</th>\n      <th>...</th>\n      <th>C20</th>\n      <th>C21</th>\n      <th>user_id</th>\n      <th>user_id&amp;media_id</th>\n      <th>user_id&amp;C14_d</th>\n      <th>user_id&amp;C17_d</th>\n      <th>user_id&amp;C14_h</th>\n      <th>user_id&amp;C17_h</th>\n      <th>time</th>\n      <th>uid_day</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>1.000009e+18</td>\n      <td>0</td>\n      <td>14102100</td>\n      <td>C1_1005</td>\n      <td>banner_pos_0</td>\n      <td>site_id_1fbe01fe</td>\n      <td>site_domain_f3845767</td>\n      <td>site_category_28905ebd</td>\n      <td>app_id_ecad2386</td>\n      <td>app_domain_7801e8d9</td>\n      <td>...</td>\n      <td>C20_-1</td>\n      <td>C21_79</td>\n      <td>user_id_ddd2926e_44956a24</td>\n      <td>user_id&amp;media_id_1</td>\n      <td>user_id&amp;C14_d_1</td>\n      <td>user_id&amp;C17_d_1</td>\n      <td>user_id&amp;C14_h_1</td>\n      <td>user_id&amp;C17_h_1</td>\n      <td>time_-1</td>\n      <td>id_day_3</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>1.000017e+19</td>\n      <td>0</td>\n      <td>14102100</td>\n      <td>C1_1005</td>\n      <td>banner_pos_0</td>\n      <td>site_id_1fbe01fe</td>\n      <td>site_domain_f3845767</td>\n      <td>site_category_28905ebd</td>\n      <td>app_id_ecad2386</td>\n      <td>app_domain_7801e8d9</td>\n      <td>...</td>\n      <td>C20_100084</td>\n      <td>C21_79</td>\n      <td>uid_rare_7</td>\n      <td>user_id&amp;media_id_1</td>\n      <td>user_id&amp;C14_d_1</td>\n      <td>user_id&amp;C17_d_1</td>\n      <td>user_id&amp;C14_h_1</td>\n      <td>user_id&amp;C17_h_1</td>\n      <td>time_-1</td>\n      <td>id_day_1</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>1.000037e+19</td>\n      <td>0</td>\n      <td>14102100</td>\n      <td>C1_1005</td>\n      <td>banner_pos_0</td>\n      <td>site_id_1fbe01fe</td>\n      <td>site_domain_f3845767</td>\n      <td>site_category_28905ebd</td>\n      <td>app_id_ecad2386</td>\n      <td>app_domain_7801e8d9</td>\n      <td>...</td>\n      <td>C20_100084</td>\n      <td>C21_79</td>\n      <td>uid_rare_2</td>\n      <td>user_id&amp;media_id_1</td>\n      <td>user_id&amp;C14_d_1</td>\n      <td>user_id&amp;C17_d_1</td>\n      <td>user_id&amp;C14_h_1</td>\n      <td>user_id&amp;C17_h_1</td>\n      <td>time_-1</td>\n      <td>id_day_1</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>1.000064e+19</td>\n      <td>0</td>\n      <td>14102100</td>\n      <td>C1_1005</td>\n      <td>banner_pos_0</td>\n      <td>site_id_1fbe01fe</td>\n      <td>site_domain_f3845767</td>\n      <td>site_category_28905ebd</td>\n      <td>app_id_ecad2386</td>\n      <td>app_domain_7801e8d9</td>\n      <td>...</td>\n      <td>C20_100084</td>\n      <td>C21_79</td>\n      <td>uid_rare_2</td>\n      <td>user_id&amp;media_id_1</td>\n      <td>user_id&amp;C14_d_1</td>\n      <td>user_id&amp;C17_d_1</td>\n      <td>user_id&amp;C14_h_1</td>\n      <td>user_id&amp;C17_h_1</td>\n      <td>time_-1</td>\n      <td>id_day_1</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>1.000068e+19</td>\n      <td>0</td>\n      <td>14102100</td>\n      <td>C1_1005</td>\n      <td>banner_pos_1</td>\n      <td>site_id_fe8cc448</td>\n      <td>site_domain_9166c161</td>\n      <td>site_category_0569f928</td>\n      <td>app_id_ecad2386</td>\n      <td>app_domain_7801e8d9</td>\n      <td>...</td>\n      <td>C20_-1</td>\n      <td>C21_157</td>\n      <td>user_id_9644d0bf_779d90c2</td>\n      <td>user_id&amp;media_id_1</td>\n      <td>user_id&amp;C14_d_1</td>\n      <td>user_id&amp;C17_d_1</td>\n      <td>user_id&amp;C14_h_1</td>\n      <td>user_id&amp;C17_h_1</td>\n      <td>time_-1</td>\n      <td>id_day_1</td>\n    </tr>\n  </tbody>\n</table>\n<p>5 rows × 32 columns</p>\n</div>"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 14
    }
   ],
   "source": [
    "train_df.head()\n",
    "\n",
    "\n"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "outputs": [],
   "source": [
    "test_df = pd.read_csv(\"test_pre_over.csv\")\n",
    "\n"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "outputs": [],
   "source": [
    "test_df2 = pd.read_csv(\"test_gbdtappend.csv\")"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "outputs": [
    {
     "data": {
      "text/plain": "(4577464, 31)"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 6
    }
   ],
   "source": [
    "test_df.shape"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "outputs": [
    {
     "data": {
      "text/plain": "(4577464, 20)"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 7
    }
   ],
   "source": [
    "test_df2.shape\n"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "outputs": [
    {
     "data": {
      "text/plain": "                    id     hour            C1        banner_pos  \\\n1.000017e+19  14103100  C1_1005  banner_pos_0  site_id_235ba823   \n1.000018e+19  14103100  C1_1005  banner_pos_0  site_id_1fbe01fe   \n1.000055e+19  14103100  C1_1005  banner_pos_0  site_id_1fbe01fe   \n1.000109e+19  14103100  C1_1005  banner_pos_0  site_id_85f751fd   \n1.000138e+19  14103100  C1_1005  banner_pos_0  site_id_85f751fd   \n\n                           site_id             site_domain    site_category  \\\n1.000017e+19  site_domain_f6ebf28e  site_category_f028772b  app_id_ecad2386   \n1.000018e+19  site_domain_f3845767  site_category_28905ebd  app_id_ecad2386   \n1.000055e+19  site_domain_f3845767  site_category_28905ebd  app_id_ecad2386   \n1.000109e+19  site_domain_c4e18dd6  site_category_50e219e0  app_id_51cedd4e   \n1.000138e+19  site_domain_c4e18dd6  site_category_50e219e0  app_id_9c13b419   \n\n                           app_id             app_domain        app_category  \\\n1.000017e+19  app_domain_7801e8d9  app_category_07d7df22  device_id_a99f214a   \n1.000018e+19  app_domain_7801e8d9  app_category_07d7df22  device_id_a99f214a   \n1.000055e+19  app_domain_7801e8d9  app_category_07d7df22  device_id_a99f214a   \n1.000109e+19  app_domain_aefc06bd  app_category_0f2161f8  device_id_a99f214a   \n1.000138e+19  app_domain_2347f47a  app_category_f95efa07  device_id_a99f214a   \n\n              ...      C20         C21             user_id user_id&media_id  \\\n1.000017e+19  ...   C21_23  uid_rare_4  user_id&media_id_1  user_id&C14_d_1   \n1.000018e+19  ...   C21_51  uid_rare_5  user_id&media_id_1  user_id&C14_d_1   \n1.000055e+19  ...   C21_51  uid_rare_7  user_id&media_id_1  user_id&C14_d_1   \n1.000109e+19  ...   C21_61  uid_rare_7  user_id&media_id_1  user_id&C14_d_1   \n1.000138e+19  ...  C21_221  uid_rare_1  user_id&media_id_1  user_id&C14_d_1   \n\n                user_id&C14_d    user_id&C17_d    user_id&C14_h user_id&C17_h  \\\n1.000017e+19  user_id&C17_d_1  user_id&C14_h_1  user_id&C17_h_1       time_-1   \n1.000018e+19  user_id&C17_d_1  user_id&C14_h_1  user_id&C17_h_1       time_-1   \n1.000055e+19  user_id&C17_d_1  user_id&C14_h_1  user_id&C17_h_1       time_-1   \n1.000109e+19  user_id&C17_d_1  user_id&C14_h_1  user_id&C17_h_1       time_-1   \n1.000138e+19  user_id&C17_d_1  user_id&C14_h_1  user_id&C17_h_1       time_-1   \n\n                  time uid_day  \n1.000017e+19  id_day_1     NaN  \n1.000018e+19  id_day_1     NaN  \n1.000055e+19  id_day_1     NaN  \n1.000109e+19  id_day_1     NaN  \n1.000138e+19  id_day_1     NaN  \n\n[5 rows x 31 columns]",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>id</th>\n      <th>hour</th>\n      <th>C1</th>\n      <th>banner_pos</th>\n      <th>site_id</th>\n      <th>site_domain</th>\n      <th>site_category</th>\n      <th>app_id</th>\n      <th>app_domain</th>\n      <th>app_category</th>\n      <th>...</th>\n      <th>C20</th>\n      <th>C21</th>\n      <th>user_id</th>\n      <th>user_id&amp;media_id</th>\n      <th>user_id&amp;C14_d</th>\n      <th>user_id&amp;C17_d</th>\n      <th>user_id&amp;C14_h</th>\n      <th>user_id&amp;C17_h</th>\n      <th>time</th>\n      <th>uid_day</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>1.000017e+19</th>\n      <td>14103100</td>\n      <td>C1_1005</td>\n      <td>banner_pos_0</td>\n      <td>site_id_235ba823</td>\n      <td>site_domain_f6ebf28e</td>\n      <td>site_category_f028772b</td>\n      <td>app_id_ecad2386</td>\n      <td>app_domain_7801e8d9</td>\n      <td>app_category_07d7df22</td>\n      <td>device_id_a99f214a</td>\n      <td>...</td>\n      <td>C21_23</td>\n      <td>uid_rare_4</td>\n      <td>user_id&amp;media_id_1</td>\n      <td>user_id&amp;C14_d_1</td>\n      <td>user_id&amp;C17_d_1</td>\n      <td>user_id&amp;C14_h_1</td>\n      <td>user_id&amp;C17_h_1</td>\n      <td>time_-1</td>\n      <td>id_day_1</td>\n      <td>NaN</td>\n    </tr>\n    <tr>\n      <th>1.000018e+19</th>\n      <td>14103100</td>\n      <td>C1_1005</td>\n      <td>banner_pos_0</td>\n      <td>site_id_1fbe01fe</td>\n      <td>site_domain_f3845767</td>\n      <td>site_category_28905ebd</td>\n      <td>app_id_ecad2386</td>\n      <td>app_domain_7801e8d9</td>\n      <td>app_category_07d7df22</td>\n      <td>device_id_a99f214a</td>\n      <td>...</td>\n      <td>C21_51</td>\n      <td>uid_rare_5</td>\n      <td>user_id&amp;media_id_1</td>\n      <td>user_id&amp;C14_d_1</td>\n      <td>user_id&amp;C17_d_1</td>\n      <td>user_id&amp;C14_h_1</td>\n      <td>user_id&amp;C17_h_1</td>\n      <td>time_-1</td>\n      <td>id_day_1</td>\n      <td>NaN</td>\n    </tr>\n    <tr>\n      <th>1.000055e+19</th>\n      <td>14103100</td>\n      <td>C1_1005</td>\n      <td>banner_pos_0</td>\n      <td>site_id_1fbe01fe</td>\n      <td>site_domain_f3845767</td>\n      <td>site_category_28905ebd</td>\n      <td>app_id_ecad2386</td>\n      <td>app_domain_7801e8d9</td>\n      <td>app_category_07d7df22</td>\n      <td>device_id_a99f214a</td>\n      <td>...</td>\n      <td>C21_51</td>\n      <td>uid_rare_7</td>\n      <td>user_id&amp;media_id_1</td>\n      <td>user_id&amp;C14_d_1</td>\n      <td>user_id&amp;C17_d_1</td>\n      <td>user_id&amp;C14_h_1</td>\n      <td>user_id&amp;C17_h_1</td>\n      <td>time_-1</td>\n      <td>id_day_1</td>\n      <td>NaN</td>\n    </tr>\n    <tr>\n      <th>1.000109e+19</th>\n      <td>14103100</td>\n      <td>C1_1005</td>\n      <td>banner_pos_0</td>\n      <td>site_id_85f751fd</td>\n      <td>site_domain_c4e18dd6</td>\n      <td>site_category_50e219e0</td>\n      <td>app_id_51cedd4e</td>\n      <td>app_domain_aefc06bd</td>\n      <td>app_category_0f2161f8</td>\n      <td>device_id_a99f214a</td>\n      <td>...</td>\n      <td>C21_61</td>\n      <td>uid_rare_7</td>\n      <td>user_id&amp;media_id_1</td>\n      <td>user_id&amp;C14_d_1</td>\n      <td>user_id&amp;C17_d_1</td>\n      <td>user_id&amp;C14_h_1</td>\n      <td>user_id&amp;C17_h_1</td>\n      <td>time_-1</td>\n      <td>id_day_1</td>\n      <td>NaN</td>\n    </tr>\n    <tr>\n      <th>1.000138e+19</th>\n      <td>14103100</td>\n      <td>C1_1005</td>\n      <td>banner_pos_0</td>\n      <td>site_id_85f751fd</td>\n      <td>site_domain_c4e18dd6</td>\n      <td>site_category_50e219e0</td>\n      <td>app_id_9c13b419</td>\n      <td>app_domain_2347f47a</td>\n      <td>app_category_f95efa07</td>\n      <td>device_id_a99f214a</td>\n      <td>...</td>\n      <td>C21_221</td>\n      <td>uid_rare_1</td>\n      <td>user_id&amp;media_id_1</td>\n      <td>user_id&amp;C14_d_1</td>\n      <td>user_id&amp;C17_d_1</td>\n      <td>user_id&amp;C14_h_1</td>\n      <td>user_id&amp;C17_h_1</td>\n      <td>time_-1</td>\n      <td>id_day_1</td>\n      <td>NaN</td>\n    </tr>\n  </tbody>\n</table>\n<p>5 rows × 31 columns</p>\n</div>"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 19
    }
   ],
   "source": [
    "test_new.head()"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "outputs": [
    {
     "data": {
      "text/plain": "(10000000, 32)"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 5
    }
   ],
   "source": [
    "train_df.shape"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "outputs": [],
   "source": [
    "train_df=train_df.join(train_df2)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "outputs": [],
   "source": [
    "test_df = test_df.join(test_df2)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "outputs": [],
   "source": [],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "outputs": [],
   "source": [
    "train_df.rename(columns={'uid_day':'C29','user_id':'C22',\n",
    "       'user_id&media_id':'C23', 'user_id&C14_d':'C24', 'user_id&C17_d':'C25', 'user_id&C14_h':'C26',\n",
    "       'user_id&C17_h':'C27', 'time':'C28' },inplace=True)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "outputs": [],
   "source": [
    "test_df.rename(columns={'uid_day':'C29','user_id':'C22',\n",
    "       'user_id&media_id':'C23', 'user_id&C14_d':'C24', 'user_id&C17_d':'C25', 'user_id&C14_h':'C26',\n",
    "       'user_id&C17_h':'C27', 'time':'C28' },inplace=True)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "outputs": [],
   "source": [
    "train_df.columns"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "outputs": [
    {
     "data": {
      "text/plain": "Index(['id', 'hour', 'C1', 'banner_pos', 'site_id', 'site_domain',\n       'site_category', 'app_id', 'app_domain', 'app_category', 'device_id',\n       'device_ip', 'device_model', 'device_type', 'device_conn_type', 'C14',\n       'C15', 'C16', 'C17', 'C18', 'C19', 'C20', 'C21', 'C22', 'C23', 'C24',\n       'C25', 'C26', 'C27', 'C28', 'C29', 'C30', 'C31', 'C32', 'C33', 'C34',\n       'C35', 'C36', 'C37', 'C38', 'C39', 'C40', 'C41', 'C42', 'C43', 'C44',\n       'C45', 'C46', 'C47', 'C48', 'C49'],\n      dtype='object')"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 10
    }
   ],
   "source": [
    "test_df.columns"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "outputs": [
    {
     "data": {
      "text/plain": "             id      hour       C1    banner_pos           site_id  \\\n0  1.000017e+19  14103100  C1_1005  banner_pos_0  site_id_235ba823   \n1  1.000018e+19  14103100  C1_1005  banner_pos_0  site_id_1fbe01fe   \n2  1.000055e+19  14103100  C1_1005  banner_pos_0  site_id_1fbe01fe   \n3  1.000109e+19  14103100  C1_1005  banner_pos_0  site_id_85f751fd   \n4  1.000138e+19  14103100  C1_1005  banner_pos_0  site_id_85f751fd   \n\n            site_domain           site_category           app_id  \\\n0  site_domain_f6ebf28e  site_category_f028772b  app_id_ecad2386   \n1  site_domain_f3845767  site_category_28905ebd  app_id_ecad2386   \n2  site_domain_f3845767  site_category_28905ebd  app_id_ecad2386   \n3  site_domain_c4e18dd6  site_category_50e219e0  app_id_51cedd4e   \n4  site_domain_c4e18dd6  site_category_50e219e0  app_id_9c13b419   \n\n            app_domain           app_category  ... C40 C41 C42 C43 C44 C45  \\\n0  app_domain_7801e8d9  app_category_07d7df22  ...  13  14  12  13   8   8   \n1  app_domain_7801e8d9  app_category_07d7df22  ...  13  14  12  13   8   8   \n2  app_domain_7801e8d9  app_category_07d7df22  ...  13  14  12  13   8   8   \n3  app_domain_aefc06bd  app_category_0f2161f8  ...  13  14  12  12   8   8   \n4  app_domain_2347f47a  app_category_f95efa07  ...  16  14  12  13   8   8   \n\n  C46 C47 C48 C49  \n0  12   8  11   8  \n1  12   8  11   8  \n2  12   8  11   8  \n3  12   8  11   8  \n4  12   8  11   8  \n\n[5 rows x 51 columns]",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>id</th>\n      <th>hour</th>\n      <th>C1</th>\n      <th>banner_pos</th>\n      <th>site_id</th>\n      <th>site_domain</th>\n      <th>site_category</th>\n      <th>app_id</th>\n      <th>app_domain</th>\n      <th>app_category</th>\n      <th>...</th>\n      <th>C40</th>\n      <th>C41</th>\n      <th>C42</th>\n      <th>C43</th>\n      <th>C44</th>\n      <th>C45</th>\n      <th>C46</th>\n      <th>C47</th>\n      <th>C48</th>\n      <th>C49</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>1.000017e+19</td>\n      <td>14103100</td>\n      <td>C1_1005</td>\n      <td>banner_pos_0</td>\n      <td>site_id_235ba823</td>\n      <td>site_domain_f6ebf28e</td>\n      <td>site_category_f028772b</td>\n      <td>app_id_ecad2386</td>\n      <td>app_domain_7801e8d9</td>\n      <td>app_category_07d7df22</td>\n      <td>...</td>\n      <td>13</td>\n      <td>14</td>\n      <td>12</td>\n      <td>13</td>\n      <td>8</td>\n      <td>8</td>\n      <td>12</td>\n      <td>8</td>\n      <td>11</td>\n      <td>8</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>1.000018e+19</td>\n      <td>14103100</td>\n      <td>C1_1005</td>\n      <td>banner_pos_0</td>\n      <td>site_id_1fbe01fe</td>\n      <td>site_domain_f3845767</td>\n      <td>site_category_28905ebd</td>\n      <td>app_id_ecad2386</td>\n      <td>app_domain_7801e8d9</td>\n      <td>app_category_07d7df22</td>\n      <td>...</td>\n      <td>13</td>\n      <td>14</td>\n      <td>12</td>\n      <td>13</td>\n      <td>8</td>\n      <td>8</td>\n      <td>12</td>\n      <td>8</td>\n      <td>11</td>\n      <td>8</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>1.000055e+19</td>\n      <td>14103100</td>\n      <td>C1_1005</td>\n      <td>banner_pos_0</td>\n      <td>site_id_1fbe01fe</td>\n      <td>site_domain_f3845767</td>\n      <td>site_category_28905ebd</td>\n      <td>app_id_ecad2386</td>\n      <td>app_domain_7801e8d9</td>\n      <td>app_category_07d7df22</td>\n      <td>...</td>\n      <td>13</td>\n      <td>14</td>\n      <td>12</td>\n      <td>13</td>\n      <td>8</td>\n      <td>8</td>\n      <td>12</td>\n      <td>8</td>\n      <td>11</td>\n      <td>8</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>1.000109e+19</td>\n      <td>14103100</td>\n      <td>C1_1005</td>\n      <td>banner_pos_0</td>\n      <td>site_id_85f751fd</td>\n      <td>site_domain_c4e18dd6</td>\n      <td>site_category_50e219e0</td>\n      <td>app_id_51cedd4e</td>\n      <td>app_domain_aefc06bd</td>\n      <td>app_category_0f2161f8</td>\n      <td>...</td>\n      <td>13</td>\n      <td>14</td>\n      <td>12</td>\n      <td>12</td>\n      <td>8</td>\n      <td>8</td>\n      <td>12</td>\n      <td>8</td>\n      <td>11</td>\n      <td>8</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>1.000138e+19</td>\n      <td>14103100</td>\n      <td>C1_1005</td>\n      <td>banner_pos_0</td>\n      <td>site_id_85f751fd</td>\n      <td>site_domain_c4e18dd6</td>\n      <td>site_category_50e219e0</td>\n      <td>app_id_9c13b419</td>\n      <td>app_domain_2347f47a</td>\n      <td>app_category_f95efa07</td>\n      <td>...</td>\n      <td>16</td>\n      <td>14</td>\n      <td>12</td>\n      <td>13</td>\n      <td>8</td>\n      <td>8</td>\n      <td>12</td>\n      <td>8</td>\n      <td>11</td>\n      <td>8</td>\n    </tr>\n  </tbody>\n</table>\n<p>5 rows × 51 columns</p>\n</div>"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 11
    }
   ],
   "source": [
    "test_df.head()"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "outputs": [],
   "source": [
    "train_df.to_csv(\"train_over.csv\",index=False)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "outputs": [],
   "source": [
    "test_df.to_csv(\"test_over.csv\",index=False)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "outputs": [],
   "source": [
    "#train_df.to_csv(\"train_pre_1\",index=False)\n",
    "\n"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "outputs": [],
   "source": [
    "del train_df"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "outputs": [],
   "source": [],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "outputs": [],
   "source": [
    "train_df = pd.read_csv(\"train_sub_count.csv\")"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "outputs": [],
   "source": [
    "test_df = pd.read_csv(\"test_sub_count.csv\")"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "outputs": [
    {
     "data": {
      "text/plain": "             id  click      hour    C1  banner_pos   site_id site_domain  \\\n0  1.000009e+18      0  14102100  1005           0  1fbe01fe    f3845767   \n1  1.000017e+19      0  14102100  1005           0  1fbe01fe    f3845767   \n2  1.000037e+19      0  14102100  1005           0  1fbe01fe    f3845767   \n3  1.000064e+19      0  14102100  1005           0  1fbe01fe    f3845767   \n4  1.000068e+19      0  14102100  1005           1  fe8cc448    9166c161   \n\n  site_category    app_id app_domain  ... C19     C20  C21            user_id  \\\n0      28905ebd  ecad2386   7801e8d9  ...  35      -1   79  ddd2926e_44956a24   \n1      28905ebd  ecad2386   7801e8d9  ...  35  100084   79  96809ac8_711ee120   \n2      28905ebd  ecad2386   7801e8d9  ...  35  100084   79  b3cf8def_8a4875bd   \n3      28905ebd  ecad2386   7801e8d9  ...  35  100084   79  e8275b8f_6332421a   \n4      0569f928  ecad2386   7801e8d9  ...  35      -1  157  9644d0bf_779d90c2   \n\n   user_id&media_id  user_id&C14_d  user_id&C17_d  user_id&C14_h  \\\n0                 1              1              1              1   \n1                 1              1              1              1   \n2                 1              1              1              1   \n3                 1              1              1              1   \n4                 1              1              1              1   \n\n   user_id&C17_h  time  \n0              1    -1  \n1              1    -1  \n2              1    -1  \n3              1    -1  \n4              1    -1  \n\n[5 rows x 31 columns]",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>id</th>\n      <th>click</th>\n      <th>hour</th>\n      <th>C1</th>\n      <th>banner_pos</th>\n      <th>site_id</th>\n      <th>site_domain</th>\n      <th>site_category</th>\n      <th>app_id</th>\n      <th>app_domain</th>\n      <th>...</th>\n      <th>C19</th>\n      <th>C20</th>\n      <th>C21</th>\n      <th>user_id</th>\n      <th>user_id&amp;media_id</th>\n      <th>user_id&amp;C14_d</th>\n      <th>user_id&amp;C17_d</th>\n      <th>user_id&amp;C14_h</th>\n      <th>user_id&amp;C17_h</th>\n      <th>time</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>1.000009e+18</td>\n      <td>0</td>\n      <td>14102100</td>\n      <td>1005</td>\n      <td>0</td>\n      <td>1fbe01fe</td>\n      <td>f3845767</td>\n      <td>28905ebd</td>\n      <td>ecad2386</td>\n      <td>7801e8d9</td>\n      <td>...</td>\n      <td>35</td>\n      <td>-1</td>\n      <td>79</td>\n      <td>ddd2926e_44956a24</td>\n      <td>1</td>\n      <td>1</td>\n      <td>1</td>\n      <td>1</td>\n      <td>1</td>\n      <td>-1</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>1.000017e+19</td>\n      <td>0</td>\n      <td>14102100</td>\n      <td>1005</td>\n      <td>0</td>\n      <td>1fbe01fe</td>\n      <td>f3845767</td>\n      <td>28905ebd</td>\n      <td>ecad2386</td>\n      <td>7801e8d9</td>\n      <td>...</td>\n      <td>35</td>\n      <td>100084</td>\n      <td>79</td>\n      <td>96809ac8_711ee120</td>\n      <td>1</td>\n      <td>1</td>\n      <td>1</td>\n      <td>1</td>\n      <td>1</td>\n      <td>-1</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>1.000037e+19</td>\n      <td>0</td>\n      <td>14102100</td>\n      <td>1005</td>\n      <td>0</td>\n      <td>1fbe01fe</td>\n      <td>f3845767</td>\n      <td>28905ebd</td>\n      <td>ecad2386</td>\n      <td>7801e8d9</td>\n      <td>...</td>\n      <td>35</td>\n      <td>100084</td>\n      <td>79</td>\n      <td>b3cf8def_8a4875bd</td>\n      <td>1</td>\n      <td>1</td>\n      <td>1</td>\n      <td>1</td>\n      <td>1</td>\n      <td>-1</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>1.000064e+19</td>\n      <td>0</td>\n      <td>14102100</td>\n      <td>1005</td>\n      <td>0</td>\n      <td>1fbe01fe</td>\n      <td>f3845767</td>\n      <td>28905ebd</td>\n      <td>ecad2386</td>\n      <td>7801e8d9</td>\n      <td>...</td>\n      <td>35</td>\n      <td>100084</td>\n      <td>79</td>\n      <td>e8275b8f_6332421a</td>\n      <td>1</td>\n      <td>1</td>\n      <td>1</td>\n      <td>1</td>\n      <td>1</td>\n      <td>-1</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>1.000068e+19</td>\n      <td>0</td>\n      <td>14102100</td>\n      <td>1005</td>\n      <td>1</td>\n      <td>fe8cc448</td>\n      <td>9166c161</td>\n      <td>0569f928</td>\n      <td>ecad2386</td>\n      <td>7801e8d9</td>\n      <td>...</td>\n      <td>35</td>\n      <td>-1</td>\n      <td>157</td>\n      <td>9644d0bf_779d90c2</td>\n      <td>1</td>\n      <td>1</td>\n      <td>1</td>\n      <td>1</td>\n      <td>1</td>\n      <td>-1</td>\n    </tr>\n  </tbody>\n</table>\n<p>5 rows × 31 columns</p>\n</div>"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 24
    }
   ],
   "source": [
    "train_df.head()"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "outputs": [],
   "source": [
    "import pickle"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "outputs": [],
   "source": [
    "fsfc = open(\"fcount.pkl\",'rb')\n",
    "fset = pickle.load(fsfc)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "outputs": [],
   "source": [
    "# fsfc_test = open(\"fcount_test.pkl\",'rb')\n",
    "# fset_test = pickle.load(fsfc_test)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "outputs": [
    {
     "data": {
      "text/plain": "{'device_ip_adb28a87',\n 'device_ip_0cf41551',\n 'device_ip_bc6e29f2',\n 'device_id_a09eb0aa',\n 'device_ip_37f9768c',\n 'device_ip_12be8be8',\n 'device_ip_99ac1ad9',\n 'device_id_9d2aa008',\n 'device_ip_97875f79',\n 'device_id_2d79d8b1',\n 'device_ip_31305b39',\n 'device_ip_5e013734',\n 'device_ip_3937be57',\n 'device_ip_23c3ff8b',\n 'device_ip_8fbcd694',\n 'device_ip_87e446d5',\n 'device_ip_e497bab1',\n 'device_ip_8c6fa5ed',\n 'device_ip_81863989',\n 'device_ip_ff9cccd4',\n 'device_ip_45dea3b2',\n 'device_ip_8a28cb7b',\n 'device_id_2df06c41',\n 'device_id_a19fca7d',\n 'device_ip_c7d1cb36',\n 'site_domain_7212918d',\n 'device_ip_355b64a4',\n 'device_ip_bff5ce13',\n 'device_model_4c01ee86',\n 'device_ip_d7301dad',\n 'device_ip_6e45bed5',\n 'device_ip_3b27685a',\n 'device_ip_6febd012',\n 'device_ip_c6563308',\n 'device_ip_e4d69194',\n 'device_ip_7eae8615',\n 'device_ip_94278f67',\n 'device_ip_22b05d5f',\n 'device_ip_8a168f48',\n 'device_ip_bbb74e13',\n 'device_ip_c97c2fc1',\n 'device_ip_aed2125c',\n 'device_ip_3d81483e',\n 'device_ip_34c688af',\n 'device_ip_9197fc9e',\n 'device_ip_762d7250',\n 'device_ip_e86101b3',\n 'device_ip_aea3fa31',\n 'device_ip_11b85fae',\n 'device_id_07e396cd',\n 'device_ip_fbbf0beb',\n 'device_ip_b85f17b5',\n 'device_ip_8eb3a0dd',\n 'device_ip_54313ef4',\n 'device_id_cc417198',\n 'device_model_fe64e635',\n 'device_ip_b5482202',\n 'device_ip_a0f511c0',\n 'device_id_19eb9b10',\n 'device_ip_41ec3ee8',\n 'device_ip_e0424cf8',\n 'device_ip_5072e033',\n 'device_ip_059d2e16',\n 'device_ip_8989e4e2',\n 'device_ip_6a5d7b64',\n 'device_ip_596c7ae6',\n 'device_ip_3aacbab8',\n 'device_ip_3de44350',\n 'device_ip_79e76502',\n 'device_ip_f84d86a4',\n 'device_ip_eb838f9a',\n 'device_ip_7401e759',\n 'device_ip_db052314',\n 'device_ip_2a6c0554',\n 'device_ip_7af5c859',\n 'device_ip_347744c0',\n 'device_id_f93a56cf',\n 'device_ip_15b45b3b',\n 'device_ip_3e8d5a9f',\n 'device_model_b7d2d645',\n 'device_ip_86f3b3be',\n 'device_id_e8ed8718',\n 'device_ip_23cd53fc',\n 'device_ip_8fbf7dea',\n 'device_ip_7b42a45d',\n 'device_ip_3e28668a',\n 'device_ip_fe2f26bb',\n 'device_ip_3ba272d8',\n 'app_id_83431aa8',\n 'device_id_7c9e7334',\n 'device_ip_f04ad298',\n 'device_ip_2970f26e',\n 'device_ip_be4e9daf',\n 'device_ip_817cbff0',\n 'device_ip_62cdf0ab',\n 'device_ip_992d9421',\n 'device_ip_ae1d8f7b',\n 'device_id_bae30a3d',\n 'device_ip_a75d8d29',\n 'device_ip_8936ff39',\n 'device_ip_29ac13c7',\n 'device_ip_aaf5f6e5',\n 'device_ip_fd1ba260',\n 'device_ip_a7c8b594',\n 'device_ip_f0c53aa3',\n 'device_ip_ad08f86d',\n 'device_ip_b80a5ad1',\n 'device_ip_6da53886',\n 'device_ip_4dd5395a',\n 'device_model_42a62f49',\n 'C17_2485',\n 'device_ip_4969bd18',\n 'device_ip_12ba7381',\n 'device_ip_217321d8',\n 'device_ip_4350dad3',\n 'device_ip_6cd6db58',\n 'device_ip_ed6beaa8',\n 'device_ip_48258e68',\n 'device_ip_45f4e1b4',\n 'device_ip_01ab2c25',\n 'device_id_fdbdf251',\n 'device_ip_0e1bc715',\n 'device_ip_89deaed5',\n 'device_ip_292a95e1',\n 'device_ip_ba783ea8',\n 'device_ip_72039d68',\n 'device_ip_a27a0d4d',\n 'device_ip_5bb1b842',\n 'device_id_415ca69d',\n 'device_ip_1e23f6b0',\n 'device_model_13472f46',\n 'device_ip_5004b9d6',\n 'device_id_8ca254bd',\n 'device_ip_e76f7005',\n 'device_id_72c6ed60',\n 'device_ip_739b6b02',\n 'device_ip_dd566c3c',\n 'device_ip_d80e31e6',\n 'device_ip_62ff86ce',\n 'device_ip_7cfa3dd1',\n 'device_ip_ae7fd757',\n 'device_ip_4708f7e7',\n 'device_ip_b9f00c19',\n 'device_ip_876527a5',\n 'device_ip_ea8004ed',\n 'device_ip_89cc9ae6',\n 'device_ip_1209faa5',\n 'site_domain_f455a4fe',\n 'device_ip_c884f94d',\n 'device_ip_ad7df094',\n 'device_ip_33d3bfd0',\n 'device_ip_3ea80945',\n 'device_ip_d5e94fd4',\n 'device_ip_72bfa848',\n 'device_ip_4bf08747',\n 'device_ip_45f2b43f',\n 'device_ip_8a3c99a1',\n 'device_ip_488080a0',\n 'device_ip_73964621',\n 'device_id_0b009566',\n 'device_ip_f52a5a30',\n 'device_ip_5c9363a6',\n 'device_id_6dc1c66d',\n 'device_ip_1811c4cb',\n 'device_ip_8eac4713',\n 'device_ip_b33b0066',\n 'device_ip_38e85d3e',\n 'device_id_355c62a1',\n 'device_ip_7dac91a4',\n 'device_ip_cab5632d',\n 'device_ip_38819bab',\n 'device_id_54b3c556',\n 'device_ip_8b82ceab',\n 'device_ip_84bfd0f5',\n 'device_ip_ec3a3941',\n 'device_ip_e9602cc1',\n 'device_ip_5aa7877c',\n 'device_ip_b8dcb667',\n 'device_id_1c676716',\n 'device_ip_250a6756',\n 'device_ip_86542de3',\n 'device_ip_5960bd22',\n 'device_id_c740bba7',\n 'device_ip_1ab3f778',\n 'app_id_72151e40',\n 'device_ip_d81c2a51',\n 'device_ip_543498c9',\n 'device_ip_dcd9850e',\n 'device_ip_1312bce2',\n 'device_ip_3cf67bd4',\n 'device_ip_2b8c340a',\n 'device_ip_0803600c',\n 'device_ip_7860a9e0',\n 'device_ip_68d96c2f',\n 'device_ip_e49bc176',\n 'device_ip_941b24d4',\n 'device_ip_648efa90',\n 'device_ip_c31bf169',\n 'device_ip_bdb6d367',\n 'device_ip_231c3db0',\n 'device_ip_b160f722',\n 'device_ip_af7d557a',\n 'site_id_df7971d4',\n 'device_id_8896de54',\n 'device_ip_f92b1e67',\n 'device_ip_4e03c026',\n 'device_ip_4f6dae9d',\n 'device_ip_ce072517',\n 'device_id_b94d2386',\n 'device_ip_8f49590b',\n 'device_id_d3603149',\n 'device_ip_ced0a028',\n 'site_id_02ffe73f',\n 'device_ip_b3b1a3a3',\n 'device_ip_a631ae42',\n 'device_ip_464c7eda',\n 'device_ip_6b3a5479',\n 'device_ip_a49ef1f6',\n 'device_ip_b5568104',\n 'device_ip_11f46d87',\n 'device_ip_4953d627',\n 'device_ip_336c1b8a',\n 'device_ip_fb5640fb',\n 'device_ip_d4cf691a',\n 'device_ip_ff58c93d',\n 'device_ip_377b709b',\n 'device_ip_b8503a51',\n 'device_ip_67e996f1',\n 'device_ip_4ee44577',\n 'device_ip_e401481a',\n 'device_id_a9791fa8',\n 'device_id_86aa8414',\n 'device_ip_d82a4f0d',\n 'device_ip_00457263',\n 'device_id_9b3056b8',\n 'device_ip_dfcc60c4',\n 'device_id_455297e2',\n 'device_ip_494a3f22',\n 'device_ip_705903a2',\n 'device_ip_ca62ab4f',\n 'device_ip_ddcd00a9',\n 'device_ip_149a63e8',\n 'device_ip_d0588f9d',\n 'device_ip_42637c4b',\n 'device_ip_189e86d6',\n 'device_ip_8a10d19e',\n 'app_id_9c726c4d',\n 'device_ip_de851268',\n 'device_ip_9f18f61e',\n 'device_ip_3227b635',\n 'device_ip_2bf0ab9c',\n 'device_ip_baaf15d8',\n 'device_ip_a4904cd0',\n 'device_ip_b52ee4c3',\n 'device_ip_12987b2c',\n 'device_ip_7604d7ce',\n 'device_model_81f481ad',\n 'device_ip_8fda4370',\n 'device_ip_8594b512',\n 'device_ip_28066ad5',\n 'device_id_85ec53f5',\n 'device_ip_40388743',\n 'device_id_99ad5fd3',\n 'device_ip_c46f375e',\n 'device_ip_6cf3d26b',\n 'device_ip_c8859f45',\n 'device_ip_cf5bfdfa',\n 'device_ip_ccfc6150',\n 'device_id_f639ea4f',\n 'device_id_48b35ff7',\n 'device_ip_4e77580a',\n 'device_ip_b08055a1',\n 'device_ip_0e019bb8',\n 'device_ip_5d609834',\n 'device_ip_1db1d957',\n 'device_ip_c8faced6',\n 'device_ip_a4efccb6',\n 'device_ip_7c6dd625',\n 'device_ip_6c694510',\n 'device_ip_f16de7cf',\n 'device_ip_597bef5c',\n 'device_ip_3f0034a4',\n 'device_ip_8788db63',\n 'site_id_207ceda8',\n 'device_ip_7ea67f54',\n 'device_ip_17d9a2b8',\n 'device_ip_f3eedf1d',\n 'device_ip_37cc6961',\n 'device_ip_85bee499',\n 'device_ip_51220889',\n 'device_ip_ac470b39',\n 'device_ip_67655a1a',\n 'device_ip_13f3ad1a',\n 'device_ip_1a257393',\n 'device_id_df210f56',\n 'device_ip_c0a2a64a',\n 'device_ip_1f16d4a4',\n 'device_ip_00a66e23',\n 'device_ip_9a40bf2a',\n 'device_id_1e22fd7d',\n 'device_ip_a9ea75c0',\n 'device_ip_c1229792',\n 'device_ip_7cccc9ab',\n 'device_ip_ee33793f',\n 'device_ip_facb982f',\n 'device_ip_d12811ea',\n 'device_ip_22c5c174',\n 'device_ip_5e730a8e',\n 'device_ip_12b92c50',\n 'device_ip_5f16fece',\n 'device_ip_0809633d',\n 'device_id_2014acf2',\n 'device_ip_520878c1',\n 'device_ip_bb08dca4',\n 'device_ip_6c6e9877',\n 'device_ip_157a1089',\n 'device_ip_1cb4b48c',\n 'device_ip_4f155d35',\n 'device_ip_93e0f838',\n 'site_domain_02acd501',\n 'device_id_0df55f00',\n 'device_model_3a3d7cab',\n 'device_ip_fc349352',\n 'device_ip_e488b8cb',\n 'device_ip_b2905a2a',\n 'site_id_f59f4e80',\n 'device_ip_7e6a19d4',\n 'device_ip_e2d2f9fe',\n 'device_ip_7feb1fcb',\n 'device_ip_dd5168e8',\n 'device_ip_41ecc282',\n 'device_ip_493eef22',\n 'device_ip_8498a7d9',\n 'device_id_ae988c51',\n 'device_ip_68b682b3',\n 'device_ip_e073c4fb',\n 'site_domain_11378a51',\n 'device_ip_ca5dc5fe',\n 'device_ip_abe2e600',\n 'device_ip_5769c87e',\n 'device_ip_96bb0df8',\n 'device_ip_28244a5c',\n 'device_ip_c557b6fb',\n 'device_ip_7e788477',\n 'device_ip_5f77529f',\n 'device_ip_1c8095fb',\n 'device_ip_0de1130c',\n 'device_ip_197e4991',\n 'device_ip_dcc211d7',\n 'device_ip_33942ed5',\n 'device_ip_4b7f0164',\n 'device_ip_0d4f7685',\n 'device_ip_f54220c9',\n 'device_ip_b8e94e8d',\n 'device_ip_33fd10b5',\n 'site_domain_934f37b4',\n 'device_id_8d20c36e',\n 'device_id_09adadfa',\n 'device_ip_b835a14a',\n 'device_ip_b5251aba',\n 'device_ip_094f87a0',\n 'device_ip_8dcbced3',\n 'device_ip_a7b3be37',\n 'device_ip_a17b3b39',\n 'device_ip_d2a185a3',\n 'device_ip_783cdcd8',\n 'device_id_18c4b834',\n 'device_ip_54eb1bfb',\n 'device_ip_0f554c8b',\n 'device_ip_835f42de',\n 'device_ip_f574c203',\n 'device_ip_e45d6053',\n 'device_ip_f332eecc',\n 'device_ip_202bbc22',\n 'device_ip_efdba3a6',\n 'device_ip_781bf751',\n 'device_ip_705316b4',\n 'device_ip_52fd8616',\n 'device_ip_37612279',\n 'device_ip_904f56a0',\n 'device_ip_72a78a1f',\n 'app_domain_27ee373d',\n 'device_ip_56bf94c2',\n 'device_id_a825a8ef',\n 'device_ip_81dee878',\n 'device_id_99f442d3',\n 'device_ip_084beeca',\n 'device_ip_e7aa2f20',\n 'device_ip_8179ee38',\n 'device_ip_c58c608e',\n 'device_ip_13467280',\n 'device_ip_71932502',\n 'device_id_2afa862f',\n 'device_id_015ebe05',\n 'device_ip_09b0a819',\n 'device_ip_5485b0c3',\n 'device_ip_2cb6c1c0',\n 'device_ip_f429eea6',\n 'device_ip_f69178eb',\n 'device_ip_ab5b6482',\n 'device_ip_913bb1c2',\n 'device_ip_3be9837d',\n 'device_ip_ce7a53c8',\n 'device_ip_23094eac',\n 'device_ip_a5c920cd',\n 'device_ip_41081980',\n 'device_ip_f6184c0f',\n 'device_ip_cdad1c01',\n 'device_ip_e4d828df',\n 'device_ip_2ac9cdd8',\n 'device_ip_b7823a1e',\n 'device_ip_100c7ab1',\n 'device_ip_cf3b031d',\n 'device_ip_c2a09084',\n 'device_ip_1cc19032',\n 'device_ip_30f747df',\n 'device_id_43377a73',\n 'device_id_b3651e73',\n 'device_ip_f095d345',\n 'device_ip_6c39237e',\n 'device_ip_7fd05c30',\n 'device_model_1760ac5a',\n 'device_ip_d0111c21',\n 'device_ip_2b0c3d20',\n 'device_ip_4b51887e',\n 'device_ip_04d1f39b',\n 'device_ip_7411bd53',\n 'device_ip_7bd4a009',\n 'device_model_d059466f',\n 'device_ip_8a6eade9',\n 'device_ip_9704f669',\n 'device_ip_8000d8d2',\n 'device_ip_6db71081',\n 'device_ip_3f815419',\n 'device_ip_2073246c',\n 'device_ip_2a0cc61a',\n 'device_ip_bd74b287',\n 'device_ip_6f7f7681',\n 'device_ip_2f3beddc',\n 'device_ip_55883ca7',\n 'device_ip_a9681dad',\n 'device_ip_3f6e6156',\n 'device_ip_fa09bf89',\n 'device_ip_bcb8db65',\n 'device_id_9f862ff7',\n 'device_ip_d4453324',\n 'device_ip_e010c15e',\n 'app_id_f9353245',\n 'device_ip_913f55c8',\n 'device_ip_7ba36f05',\n 'device_model_9eb5b693',\n 'device_id_00830c92',\n 'device_ip_30c78861',\n 'device_ip_996d23b6',\n 'device_ip_dbe5b3ab',\n 'device_ip_e358ac64',\n 'device_id_3fe0db2f',\n 'device_ip_1ebbd59f',\n 'device_ip_904140b1',\n 'device_ip_5f76f513',\n 'device_id_9bc2b99d',\n 'device_ip_ef61bd81',\n 'device_ip_ae78a14a',\n 'device_ip_a3befaa0',\n 'device_id_f7e270ae',\n 'device_ip_bfdafdc2',\n 'device_ip_e584976c',\n 'device_ip_a640fef5',\n 'device_ip_25f4ece2',\n 'device_ip_0dc60026',\n 'device_ip_94bb0025',\n 'device_ip_a1e57208',\n 'device_ip_80f97c79',\n 'site_domain_d1007c6d',\n 'device_ip_722ffddf',\n 'device_id_3c79e2df',\n 'device_id_9783d354',\n 'device_ip_3634fe5f',\n 'device_ip_ebb6fa1f',\n 'app_id_6f113d89',\n 'device_ip_7fdf5746',\n 'device_ip_38833bad',\n 'device_ip_e83e6fb2',\n 'device_ip_01cbbce2',\n 'device_ip_1a26048b',\n 'device_ip_a4f0afec',\n 'device_id_82575ffd',\n 'device_ip_6737a778',\n 'device_model_9d199e7c',\n 'device_ip_7ef30e00',\n 'device_ip_7055922d',\n 'device_ip_96f4498d',\n 'device_ip_a4616152',\n 'device_ip_a2cfce60',\n 'device_ip_5e3e4b0c',\n 'device_ip_278e18cc',\n 'device_ip_97d9119e',\n 'device_id_2fe941d8',\n 'device_ip_f8d4a211',\n 'device_ip_aaf1078a',\n 'device_ip_da1634ee',\n 'device_ip_67f889e6',\n 'device_ip_9ac18535',\n 'device_id_b7d76dd9',\n 'device_ip_9ceada69',\n 'device_ip_90c9d294',\n 'device_ip_b2ac4ae9',\n 'device_ip_0139215f',\n 'device_ip_0ccb2fe2',\n 'device_ip_d5ce82ab',\n 'device_ip_f9547bf9',\n 'device_ip_4ef09d9e',\n 'device_id_3695d3fe',\n 'site_id_b2d8b013',\n 'device_ip_707aa256',\n 'device_ip_1a083e8f',\n 'device_ip_86cc0b91',\n 'device_ip_89e36b6b',\n 'device_ip_a7d318c7',\n 'site_id_addf1d39',\n 'device_ip_29741de7',\n 'device_ip_9d0b2260',\n 'device_id_e704974e',\n 'device_model_47453c2a',\n 'device_ip_ffcf75aa',\n 'device_ip_01f16afa',\n 'site_id_46aba789',\n 'device_ip_b75ae9d4',\n 'device_ip_10fc31b1',\n 'device_ip_16b99601',\n 'device_ip_f65dd52f',\n 'device_ip_7d4f264a',\n 'device_ip_0b1b2e71',\n 'device_id_f2da9a93',\n 'device_ip_18d92e69',\n 'device_model_efb02a8f',\n 'app_domain_47464e95',\n 'device_ip_8b15e9e4',\n 'device_ip_1a66d56d',\n 'device_ip_5581c4df',\n 'device_ip_cc839a97',\n 'device_ip_ad30f845',\n 'device_ip_7fbd4d9b',\n 'device_ip_fec55186',\n 'device_ip_3a5fe10b',\n 'device_id_56d73c82',\n 'device_ip_ba6ae7df',\n 'device_ip_f00fef08',\n 'device_ip_8840cf5e',\n 'device_model_977a2929',\n 'device_ip_7b2451ad',\n 'device_ip_7edde68b',\n 'device_ip_f77562ed',\n 'device_ip_669083a3',\n 'device_ip_092d4932',\n 'device_id_9ac9d4d0',\n 'device_id_ee11165f',\n 'device_ip_d1a3dcdb',\n 'device_ip_a4be5e87',\n 'device_ip_f8c603db',\n 'device_ip_ac3ec831',\n 'device_ip_924f60ff',\n 'device_ip_d6a39ae3',\n 'device_id_ac135d9f',\n 'device_ip_8b77aa3f',\n 'app_id_80e548cc',\n 'device_ip_fb6b9227',\n 'device_model_38fa4765',\n 'device_id_d75167bf',\n 'device_ip_0258b238',\n 'device_ip_7446a028',\n 'device_ip_548b99d6',\n 'device_ip_b0e8ab98',\n 'device_ip_f53da33c',\n 'device_ip_9bde5e0e',\n 'device_ip_f7ca0313',\n 'device_model_67fcfd53',\n 'device_ip_ca2819c3',\n 'device_id_18f98ea7',\n 'device_ip_2d743cb3',\n 'device_ip_6d2cc0c0',\n 'site_id_455ac0d0',\n 'device_ip_e2ce24da',\n 'device_ip_d3a190e4',\n 'device_id_60d4182d',\n 'device_id_e1f97a0a',\n 'device_id_00ab6fb1',\n 'device_ip_2c1183ab',\n 'device_ip_a30bc97c',\n 'app_id_aba4cedf',\n 'device_ip_e31b5fd5',\n 'device_ip_7d1fd0c2',\n 'device_model_b2083177',\n 'device_ip_01677def',\n 'device_id_73fba3dc',\n 'device_ip_4075f9ae',\n 'device_ip_152bb230',\n 'device_ip_670db048',\n 'site_id_43907498',\n 'device_ip_1e2235fd',\n 'device_ip_15816dc5',\n 'device_ip_ad70749e',\n 'device_ip_427f1a97',\n 'device_ip_f3cadeb8',\n 'device_ip_1a4ca7b8',\n 'device_ip_da36922b',\n 'device_ip_7d361a9c',\n 'device_ip_01f81114',\n 'device_ip_5622b0f8',\n 'device_ip_939c5682',\n 'device_id_c59e2c4b',\n 'device_ip_1f1ad49f',\n 'device_ip_1e97787a',\n 'device_ip_a041152a',\n 'app_id_49ce75e6',\n 'device_ip_296fc7da',\n 'device_ip_cacbd173',\n 'device_id_0f01c85c',\n 'app_id_d1f14f7d',\n 'device_ip_964fc775',\n 'device_ip_6ac7271f',\n 'device_ip_2205858b',\n 'device_ip_7544b68a',\n 'site_domain_9a302a77',\n 'device_ip_bf034044',\n 'device_ip_73717546',\n 'device_ip_2f8a3f7d',\n 'device_id_74a8d434',\n 'device_ip_b7335f17',\n 'device_ip_d108b37e',\n 'device_ip_c8f629fb',\n 'device_ip_9c099d8f',\n 'device_ip_efd7db7e',\n 'device_ip_2dc4a803',\n 'device_ip_e3cbb592',\n 'device_ip_04b826cc',\n 'device_ip_a1bd4867',\n 'device_ip_1af6fd2f',\n 'device_ip_f4aa20d1',\n 'device_ip_8f2ad1f5',\n 'site_domain_9ae6fadd',\n 'device_ip_e8153610',\n 'device_ip_cac944ac',\n 'device_model_cd5b1559',\n 'device_ip_e7935155',\n 'device_ip_60f2e189',\n 'device_ip_c5b968ed',\n 'device_ip_cd43b83a',\n 'device_ip_06aafeac',\n 'device_ip_f3ad8d9f',\n 'device_ip_f9f892c6',\n 'device_ip_a7a3cb62',\n 'device_ip_ca13f58a',\n 'device_ip_b833749b',\n 'device_ip_75e53fb9',\n 'device_ip_7e9c5924',\n 'device_ip_8a9e1cc2',\n 'device_id_6a7f362c',\n 'device_ip_b44df892',\n 'device_ip_aaac95c0',\n 'device_ip_653d110d',\n 'device_ip_cff4b7b6',\n 'device_ip_627814b7',\n 'device_ip_de173f94',\n 'device_ip_b87fb5d5',\n 'device_ip_f8eb6697',\n 'device_ip_b0933c41',\n 'device_ip_7a7acb22',\n 'device_ip_fc2869d5',\n 'device_ip_1b10feb5',\n 'device_id_0b2e2d06',\n 'device_ip_684c694c',\n 'device_model_b4191635',\n 'device_ip_73cfa9fb',\n 'device_ip_f43130ad',\n 'device_id_4b12b096',\n 'device_ip_69803675',\n 'device_id_4572ca25',\n 'device_ip_15ae7d78',\n 'device_ip_3a7c5528',\n 'device_id_f6c630a9',\n 'device_id_3c0b1e82',\n 'device_ip_5c33e4dd',\n 'device_ip_b3845c1b',\n 'device_ip_76ffc18d',\n 'device_id_42bb08de',\n 'device_ip_6f24b067',\n 'device_ip_55778ef7',\n 'device_ip_3fb326ec',\n 'device_model_aad45b01',\n 'device_ip_f3c2c510',\n 'device_ip_34f128c0',\n 'device_id_87317026',\n 'device_ip_fde9ab97',\n 'device_ip_2ea5b950',\n 'device_ip_8d370648',\n 'device_ip_5ec00530',\n 'device_ip_93798fd1',\n 'device_ip_28ed14e4',\n 'device_ip_75aeff76',\n 'device_ip_913959e1',\n 'device_ip_30d5962d',\n 'device_ip_e0708a52',\n 'device_ip_cb1751b6',\n 'device_ip_4c7e19a0',\n 'device_model_f6548916',\n 'device_ip_6f85ad82',\n 'device_ip_352d6638',\n 'device_ip_554a294a',\n 'device_ip_2c59bf40',\n 'device_ip_58565a55',\n 'device_ip_6ff12bb3',\n 'device_id_fe6c599d',\n 'device_ip_8f519ba1',\n 'device_ip_07f30871',\n 'device_ip_a7f575f3',\n 'device_id_ecf8ed6e',\n 'device_ip_630035bf',\n 'device_ip_d31d69ee',\n 'device_ip_f7b9e9ab',\n 'device_id_ff51eef7',\n 'device_id_1a19b8f6',\n 'device_ip_df9f4fc3',\n 'device_ip_abe9a5cf',\n 'device_ip_1cb1cb9c',\n 'device_id_29eaa356',\n 'device_ip_348562d0',\n 'device_ip_617a3c56',\n 'device_ip_99e6cef1',\n 'device_ip_5c5664e2',\n 'device_ip_790594ad',\n 'device_ip_d20d0cd4',\n 'device_model_64a7b95b',\n 'device_ip_f4932efc',\n 'device_ip_f122543c',\n 'device_ip_bfef35a0',\n 'device_ip_66ea046f',\n 'device_ip_304eec76',\n 'device_model_2a0194cc',\n 'device_id_351e08ea',\n 'device_id_314d1801',\n 'device_ip_681deb63',\n 'device_ip_e66d00ae',\n 'device_ip_6d8152af',\n 'device_ip_59e508fe',\n 'device_ip_1efd8921',\n 'device_ip_c406b1c7',\n 'device_ip_0bf44126',\n 'device_ip_880a2160',\n 'device_ip_dd8dcffa',\n 'C14_21412',\n 'device_ip_c90c8582',\n 'device_ip_82e15320',\n 'device_ip_5d39de88',\n 'site_domain_b71d0e4f',\n 'device_id_0df53e29',\n 'device_ip_16c18353',\n 'device_id_b5e4c229',\n 'device_ip_ea0fe301',\n 'device_ip_0c190170',\n 'device_id_c20ae6f7',\n 'device_ip_24ecacd5',\n 'site_id_71b18e86',\n 'device_ip_1938eb85',\n 'device_ip_880b2d23',\n 'device_ip_7176f866',\n 'device_ip_afa6d552',\n 'device_id_4b28435d',\n 'device_id_26888aab',\n 'device_id_835a97ad',\n 'device_ip_cb08ecb6',\n 'device_model_3c55fad5',\n 'device_ip_b08fb80b',\n 'device_id_1f8d461e',\n 'device_ip_2631355c',\n 'device_ip_48a4d49b',\n 'device_ip_ee32bdd9',\n 'device_ip_a4b56395',\n 'device_ip_1004661e',\n 'device_id_c35da017',\n 'device_ip_93bad1c0',\n 'device_ip_de1f82c6',\n 'device_ip_6f8cb581',\n 'device_ip_91b60a28',\n 'device_ip_71f63a80',\n 'device_ip_b54513c8',\n 'device_id_bdb18f6a',\n 'device_ip_72b1c28e',\n 'device_ip_e37b8097',\n 'device_ip_c5a3e4d2',\n 'device_ip_0eb79e21',\n 'device_ip_50467a29',\n 'device_ip_a7c53cc9',\n 'device_ip_8fb57206',\n 'device_ip_749c3b3b',\n 'device_ip_656e6718',\n 'device_ip_91d30dc2',\n 'device_ip_e8e329bd',\n 'device_id_73f57d69',\n 'device_ip_18715865',\n 'device_ip_c0295377',\n 'device_ip_90918a6b',\n 'device_ip_39e9c0f4',\n 'device_id_247be25c',\n 'device_id_a17ad921',\n 'device_ip_e4f177c1',\n 'device_ip_740b025c',\n 'device_ip_5a243877',\n 'device_ip_1711d65c',\n 'device_ip_d5017bab',\n 'device_id_32f98a69',\n 'device_ip_1fda3b2e',\n 'device_ip_196aea0a',\n 'device_ip_30b645ec',\n 'site_id_9cd214b2',\n 'device_ip_c22c7954',\n 'device_ip_bf92cee6',\n 'device_ip_4f98f1ed',\n 'device_ip_42ab5b52',\n 'device_ip_45b8b79e',\n 'device_ip_f5cdd6da',\n 'device_ip_cd030ef4',\n 'device_ip_905696df',\n 'device_ip_dad2c717',\n 'device_ip_a20c02eb',\n 'device_ip_b938d65b',\n 'device_ip_b591f70a',\n 'device_ip_56253df3',\n 'device_ip_14db1f1c',\n 'device_ip_ad6fa103',\n 'device_id_dd04dee5',\n 'device_ip_b0f38d4c',\n 'device_id_b4813428',\n 'device_ip_287ff65d',\n 'device_id_b263f0a3',\n 'device_ip_ee06d607',\n 'device_ip_0f6f6344',\n 'site_domain_5da2058a',\n 'device_ip_0876c399',\n 'device_ip_41c7136b',\n 'app_id_d33adecf',\n 'device_ip_ad72a6f0',\n 'device_ip_99ccd9b8',\n 'device_ip_487e641d',\n 'device_ip_4f663ffe',\n 'device_ip_9a598867',\n 'device_ip_41d31c2e',\n 'device_ip_8671af82',\n 'device_ip_104dd256',\n 'device_id_e82aae14',\n 'device_ip_f0713690',\n 'device_ip_596d2298',\n 'device_ip_6e520d37',\n 'device_ip_1945c435',\n 'device_ip_80ffbfc3',\n 'site_id_1edf0277',\n 'device_id_6b9cdaeb',\n 'device_id_6ccdc507',\n 'device_id_86fe8aeb',\n 'device_ip_0d6536d5',\n 'site_domain_586e2717',\n 'device_ip_ae4e28a8',\n 'device_id_90d78bcc',\n 'device_ip_e3346073',\n 'device_ip_ba822a04',\n 'device_ip_6524ac7a',\n 'device_ip_e9d0fd3d',\n 'device_id_ce1273ac',\n 'device_ip_99363c68',\n 'device_id_6fe1bb54',\n 'device_ip_108b3f1b',\n 'device_ip_c69df0da',\n 'device_ip_7ef4f570',\n 'device_ip_ac2edd0a',\n 'device_ip_590660db',\n 'device_ip_991b2f99',\n 'device_ip_6c3ff8c6',\n 'device_ip_de039ddd',\n 'device_ip_4df8d428',\n 'device_ip_623424d7',\n 'device_ip_763bd0de',\n 'device_id_a4c7824f',\n 'app_id_22369a94',\n 'device_ip_1a2f09d3',\n 'device_ip_4e39d75a',\n 'device_ip_aa185bc5',\n 'device_ip_b2cde88a',\n 'device_ip_7023518d',\n 'device_ip_d9d023f9',\n 'device_ip_21afd96f',\n 'device_ip_cf9457ae',\n 'device_ip_a734d3c3',\n 'device_ip_db523513',\n 'device_ip_3d42f681',\n 'device_ip_956d927f',\n 'device_ip_04cccaaf',\n 'device_ip_e448bb10',\n 'device_ip_677e8b88',\n 'device_ip_697e4db6',\n 'device_ip_3dd756d6',\n 'device_id_984bd4fe',\n 'device_ip_c8e03473',\n 'device_ip_6a1904ab',\n 'device_ip_fdded969',\n 'device_ip_80d81381',\n 'device_id_337abac9',\n 'device_ip_f11d2c9d',\n 'device_ip_7f72ea66',\n 'device_id_406fa7f4',\n 'device_ip_9de72e2a',\n 'device_ip_3818d92f',\n 'device_id_e0f80514',\n 'device_ip_3327915c',\n 'device_ip_05d9776a',\n 'device_model_c088ace8',\n 'device_ip_fc3bf995',\n 'site_id_2398553f',\n 'site_id_3a77112d',\n 'device_ip_9fed8402',\n 'app_domain_863f4950',\n 'device_ip_869491b2',\n 'device_ip_e88f98c8',\n 'device_ip_48865c51',\n 'device_ip_0b3e577e',\n 'device_ip_87725489',\n 'device_ip_39dde7ec',\n 'device_ip_ead569b8',\n 'device_ip_9e7279ca',\n 'device_id_367ff726',\n 'device_ip_2606fdf5',\n 'device_ip_9a686c2b',\n 'device_ip_dcb4209e',\n 'device_ip_c61e7a5d',\n 'device_ip_60950859',\n 'device_ip_da29a570',\n 'device_id_6eeaf444',\n 'device_ip_1b19222e',\n 'device_ip_f363cc19',\n 'device_ip_6a0c8286',\n 'device_ip_314afd98',\n 'device_ip_5608ec31',\n 'device_ip_0a9a1094',\n 'device_ip_0a729afd',\n 'device_ip_9ad0bc15',\n 'device_ip_75fe5ff9',\n 'device_ip_b17a301f',\n 'device_id_e80cdfb7',\n 'device_ip_3fc3acbd',\n 'C14_21672',\n 'device_ip_2bb8fa9f',\n 'device_ip_0bad7aa5',\n 'device_ip_ce9076c7',\n 'device_id_19dce684',\n 'device_ip_6cec258d',\n 'device_ip_9ba059e7',\n 'device_ip_026e618a',\n 'device_ip_5660cee6',\n 'device_ip_b0789f7b',\n 'device_ip_d12525b0',\n 'device_ip_5c415212',\n 'device_ip_3ac9da0e',\n 'device_ip_f7c58f54',\n 'device_ip_42b2fbf2',\n 'device_ip_f2234c34',\n 'device_id_1ee26b70',\n 'device_ip_958b1639',\n 'device_ip_165f9931',\n 'C17_2372',\n 'device_ip_c876f5d8',\n 'site_domain_a8018e18',\n 'device_id_084f26fa',\n 'device_ip_c8a23ef6',\n 'device_ip_6281d29e',\n 'device_ip_a38af074',\n 'device_ip_7b5a4ed9',\n 'device_ip_aa7f8fda',\n 'device_ip_f8281201',\n 'device_id_8d799caa',\n 'device_id_e27eeae9',\n 'device_ip_d2f21f21',\n 'device_ip_e5cd1d31',\n 'device_ip_02c1adc3',\n 'device_ip_5efbd706',\n 'device_id_6eb40a41',\n 'device_ip_02dc7ec2',\n 'device_ip_e1b6d304',\n 'device_ip_5306f387',\n 'device_id_3998bddd',\n 'device_ip_057ee0b4',\n 'device_id_5778980d',\n 'device_ip_fce6b99a',\n 'device_ip_ff585d1d',\n 'device_ip_4df8fba8',\n 'device_ip_72282787',\n 'device_ip_f6e7b11b',\n 'device_ip_a8d7850c',\n 'device_id_4f5191cc',\n 'device_id_9a63ca91',\n 'device_ip_b97afb97',\n 'device_ip_980ffa3b',\n ...}"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 15
    }
   ],
   "source": [
    "fset"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "outputs": [],
   "source": [
    "count = 0\n",
    "site_null = \"85f751fd\"\n",
    "d = {}\n",
    "dc = {}\n",
    "l = []"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "outputs": [],
   "source": [
    "def prep(df):\n",
    "    global count,site_null,dc,d,l\n",
    "    if \"device_ip_\"+df[\"device_ip\"] in fset:\n",
    "        \n",
    "        w = df[\"site_category\"]\n",
    "        if df['site_id'] == site_null:\n",
    "            w = df['app_category']\n",
    "        if w not in dc:\n",
    "            dc[w] = set()\n",
    "            dc[w].add(df[\"device_ip\"])\n",
    "        else:\n",
    "            dc[w].add(df[\"device_ip\"])\n",
    "        \n",
    "        if w not in d:\n",
    "            l.append(w)\n",
    "            d[w] = len(l)-1"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "outputs": [],
   "source": [
    "# def prep_test(df):\n",
    "#     global count,site_null,dc,d,l\n",
    "#     if \"device_ip_\"+df[\"device_ip\"] in fset_test:\n",
    "#         \n",
    "#         w = df[\"site_category\"]\n",
    "#         if df['site_id'] == site_null:\n",
    "#             w = df['app_category']\n",
    "#         if w not in dc:\n",
    "#             dc[w] = set()\n",
    "#             dc[w].add(df[\"device_ip\"])\n",
    "#         else:\n",
    "#             dc[w].add(df[\"device_ip\"])\n",
    "#         \n",
    "#         if w not in d:\n",
    "#             l.append(w)\n",
    "#             d[w] = len(l)-1"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "outputs": [
    {
     "data": {
      "text/plain": "0          None\n1          None\n2          None\n3          None\n4          None\n           ... \n9999995    None\n9999996    None\n9999997    None\n9999998    None\n9999999    None\nLength: 10000000, dtype: object"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 19
    }
   ],
   "source": [
    "train_df.apply(prep,axis=1)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "outputs": [
    {
     "data": {
      "text/plain": "0          None\n1          None\n2          None\n3          None\n4          None\n           ... \n4577459    None\n4577460    None\n4577461    None\n4577462    None\n4577463    None\nLength: 4577464, dtype: object"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 20
    }
   ],
   "source": [
    "test_df.apply(prep,axis=1)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "outputs": [],
   "source": [
    "for k in dc:\n",
    "    dc[k] = len(dc[k])\n",
    "\n"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "outputs": [
    {
     "data": {
      "text/plain": "{'28905ebd': 48263,\n '0569f928': 625,\n 'f028772b': 80625,\n '0f2161f8': 70384,\n '3e814130': 44888,\n '8ded1f7a': 20048,\n '75d80bbe': 849,\n 'f95efa07': 13469,\n '07d7df22': 6029,\n '76b2941d': 6367,\n '50e219e0': 24617,\n 'f66779e6': 8440,\n '72722551': 1066,\n 'cef3e649': 27312,\n '335d28a8': 3507,\n '75fa27f6': 6576,\n '4ce2e9fc': 528,\n 'd1327cf5': 5223,\n 'c0dd3be3': 959,\n 'bcf865d9': 68,\n 'a3c42688': 180,\n '0f9a328c': 424,\n 'fc6fa53d': 731,\n '879c24eb': 213,\n '09481d60': 1660,\n 'dc97ec06': 470,\n 'a818d37a': 229,\n '42a36e14': 63,\n 'a86a3e89': 65,\n 'a7fd01ec': 12,\n '70fb0e29': 269,\n '4681bb9d': 148,\n 'dedf689d': 207,\n '5378d028': 7,\n '8df2e842': 88,\n 'e787de0e': 24,\n '8fd0aea4': 13,\n '79f0b860': 12,\n '2281a340': 33,\n '0bfbc358': 26,\n '9ccfa2ea': 7,\n '74073276': 1,\n '4b7ade46': 1,\n '7113d72a': 3,\n '5326cf99': 3,\n 'ef03ae90': 1,\n '52de74cf': 1,\n '110ab22d': 1,\n '18b1e0be': 1}"
     },
     "metadata": {},
     "output_type": "execute_result",
     "execution_count": 35
    }
   ],
   "source": [
    "dc"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "outputs": [],
   "source": [
    "pickle.dump([d,dc], open(\"ip_dict.pkl\", 'wb'))  \n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n",
     "is_executing": false
    }
   }
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  },
  "pycharm": {
   "stem_cell": {
    "cell_type": "raw",
    "source": [],
    "metadata": {
     "collapsed": false
    }
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}